<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="../js/vue.js"></script>
</head>

<body>
  <div id="app">
    <span v-if="isUser">
      <label for="userName">用户账号:</label>
      <input type="text" id="userName" placeholder="请输入用户账号">
    </span>
    <span v-else>
      <label for="userEmail">用户邮箱:</label>
      <input type="text" id="" placeholder="请输入用户邮箱">
    </span>
    <button @click="change">切换类型</button>
  </div>

  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        isUser: true
      },
      methods: {
        change() {
          this.isUser = !this.isUser
        }
      }
    });
  </script>
</body>

</html>